<?php
header("Content-Type: text/html");
header("charset: utf-8");
include_once("_common.php");

$sql = " select count(*) cnt from g4_lounge where mb_id = '$mb_id' and lounge = '$lounge' ";
$row = sql_fetch($sql);
$ajax_cnt = $row['cnt'];

if($ajax_cnt == "0"){
	$sql = " insert into g4_lounge ( mb_id, lounge )
    	     values ( '$mb_id', '$lounge' ) ";
	sql_query($sql);
}else{
	$sql = " delete from g4_lounge where mb_id = '{$mb_id}' and lounge = '{$lounge}' ";
	sql_query($sql);
}

echo $ajax_cnt;
?>